<ol class="breadcrumb">
	<li><a href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'index'), null, true); ?>">Home</a></li>
	<li><a href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'candidato'), null, true); ?>">Candidatos</a></li>
	<li class="active">Resultados</li>
</ol>

<nav class="navbar navbar-default" role="navigation">
	<div class="container-fluid">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
		</div>
		<div class="collapse navbar-collapse navbar-search" id="bs-example-navbar-collapse-2">
            <div class="row">
    			<form method="post" action="<?php echo $this->url(array('module' => 'admin', 'controller' => 'resultado'), null, true); ?>" class="navbar-form" role="search">
        			 <div class="row">
                        <div class="col-lg-8">
                        	<div class="row">
                            	<button type="button" class="btn btn-success" onclick="document.location.href='<?php echo $this->url(array('module' => 'admin', 'controller' => 'resultado', 'action' => 'add'), null, true); ?>'">cadastrar</button>
        					</div>
        				</div>
        				<div class="col-lg-4 pull-right">
        					<div class="row">
	        					<div class="input-group">
	        						<?php echo $this->form->filtro_busca; ?>
	        						<span class="input-group-btn">
	        							<button class="btn btn-success" type="submit">
	        								<span class="glyphicon glyphicon-search"></span>
	        							</button>
	        						</span>
	        					</div>
	        				</div>
        				</div>
                    </div>
    			</form>
			</div>
		</div>
	</div>
</nav>

<?php if(count($this->messages) > 0) : ?>
<div class="alert alert-success"><?php echo current($this->messages[0]); ?></div>
<?php endif; ?>

<table class="table table-striped">
	<tr>
		<th>Resultado</th>
		<th width="80">Opções</th>
	</tr>
	<?php foreach ($this->resultados as $resultado): ?>
	<tr>
		<td><?php echo $resultado['descricao']; ?></td>
		<td>
			<div class="col-xs-2">
				<a href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'resultado', 'action' => 'edit', 'id' => $resultado['id']), null, true); ?>">
					<span class="glyphicon glyphicon-pencil"></span>
				</a>
			</div>
			<div class="col-xs-2">
				<a class="dialog-delete" href="#" data-action="<?php echo $this->url(array('module' => 'admin', 'controller' => 'resultado', 'action' => 'delete', 'id' => $resultado['id']), null, true); ?>">
					<span class="glyphicon glyphicon-remove"></span>
				</a>
			</div>
		</td>
	</tr>
	<?php endforeach; ?>
</table>

<?php echo $this->paginationControl($this->resultados, 'Sliding', 'paginator.phtml'); ?>